package com.ruoyi.finance.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.finance.domain.Distributorincome;
import com.ruoyi.finance.mapper.DistributorincomeMapper;
import com.ruoyi.finance.service.IDistributorincomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 分销员收入Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-10
 */
@Service
public class DistributorincomeServiceImpl implements IDistributorincomeService 
{
    @Autowired
    private DistributorincomeMapper distributorincomeMapper;

    /**
     * 查询分销员收入
     * 
     * @param distributorId 分销员收入主键
     * @return 分销员收入
     */
    @Override
    public Distributorincome selectDistributorincomeByDistributorId(Long distributorId)
    {
        return distributorincomeMapper.selectDistributorincomeByDistributorId(distributorId);
    }

    /**
     * 查询分销员收入列表
     * 
     * @param distributorincome 分销员收入
     * @return 分销员收入
     */
    @Override
    public List<Distributorincome> selectDistributorincomeList(Distributorincome distributorincome)
    {
        return distributorincomeMapper.selectDistributorincomeList(distributorincome);
    }

    /**
     * 新增分销员收入
     * 
     * @param distributorincome 分销员收入
     * @return 结果
     */
    @Override
    public int insertDistributorincome(Distributorincome distributorincome)
    {
        distributorincome.setCreateTime(DateUtils.getNowDate());
        return distributorincomeMapper.insertDistributorincome(distributorincome);
    }

    /**
     * 修改分销员收入
     * 
     * @param distributorincome 分销员收入
     * @return 结果
     */
    @Override
    public int updateDistributorincome(Distributorincome distributorincome)
    {
        distributorincome.setUpdateTime(DateUtils.getNowDate());
        return distributorincomeMapper.updateDistributorincome(distributorincome);
    }

    /**
     * 批量删除分销员收入
     * 
     * @param distributorIds 需要删除的分销员收入主键
     * @return 结果
     */
    @Override
    public int deleteDistributorincomeByDistributorIds(Long[] distributorIds)
    {
        return distributorincomeMapper.deleteDistributorincomeByDistributorIds(distributorIds);
    }

    /**
     * 删除分销员收入信息
     * 
     * @param distributorId 分销员收入主键
     * @return 结果
     */
    @Override
    public int deleteDistributorincomeByDistributorId(Long distributorId)
    {
        return distributorincomeMapper.deleteDistributorincomeByDistributorId(distributorId);
    }
}
